<?php
class IndexAction extends Action {
	public function index() {
		$this->assign ( 'title', '羽毛球积分赛 - 首页' );
		
		// 判断用户登录信息
		$this->assign ( 'admin', 'none' );
		if (session ( 'username' )) {
			$this->assign ( 'loginuser', session ( 'username' ) );
			$this->assign ( 'userscore', session ( 'userscore' ) );
			$this->assign ( 'usermatchcount', session ( 'usermatchcount' ) );
			$this->assign ( 'loginusercolor', get_color ( session ( 'usergender' ) ) );
			
			if (intval ( session ( 'userlevel' ) ) < 1) {
				$this->assign ( 'userstatus', '（未认证）' );
			} else {
				$this->assign ( 'userstatus', '' );
			}
			
			if (intval ( session ( 'userlevel' ) ) > 1) {
				$this->assign ( 'admin', 'inline' );
			}
			
			$this->assign ( 'logoffblock', 'inline' );
			$this->assign ( 'loginblock', 'none' );
		} else {
			$this->assign ( 'logoffblock', 'none' );
			$this->assign ( 'loginblock', 'inline' );
		}
		
		$this->display ();
	}
}